<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>The V8Js class</title>
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-base.css" />
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-medium.css" />

 </head>
 <body class="docs"><div class="navbar navbar-fixed-top">
  <div class="navbar-inner clearfix">
    <ul class="nav" style="width: 100%">
      <li style="float: left;"><a href="v8js.examples.html">« 范例</a></li>
      <li style="float: right;"><a href="v8js.construct.html">V8Js::__construct »</a></li>
    </ul>
  </div>
</div>
<div id="breadcrumbs" class="clearfix">
  <ul class="breadcrumbs-container">
    <li><a href="index.html">PHP Manual</a></li>
    <li><a href="book.v8js.html">V8js</a></li>
    <li>The V8Js class</li>
  </ul>
</div>
<div id="layout">
  <div id="layout-content"><div id="class.v8js" class="reference">
 <h1 class="title">The <span class="classname"><a href="class.v8js.html" class="classname">V8Js</a></span> class</h1>
 

 <div class="partintro"><p class="verinfo">(PECL v8js &gt;= 0.1.0)</p>


  <div class="section" id="v8js.intro">
   <h2 class="title">简介</h2>
   <p class="para">
    This is the core class for V8Js extension. Each instance created from
    this class has own context in which all JavaScript is compiled and
    executed.
   </p>
   <p class="para">
    See <span class="function"><a href="v8js.construct.html" class="function">V8Js::__construct()</a></span> for more information.
   </p>
  </div>


  <div class="section" id="v8js.synopsis">
   <h2 class="title">类摘要</h2>


   <div class="classsynopsis">
    <div class="ooclass"></div>


    <div class="classsynopsisinfo">
     <span class="ooclass">
      <span class="modifier">class</span> <strong class="classname">V8Js</strong>
     </span>
     {</div>

    <div class="classsynopsisinfo classsynopsisinfo_comment">/* Constants */</div>
    <div class="fieldsynopsis">
     <span class="modifier">const</span>
     <span class="type">string</span>
      <var class="fieldsynopsis_varname"><a href="class.v8js.html#v8js.constants.v8-version"><var class="varname">V8_VERSION</var></a></var>;</div>

    <div class="fieldsynopsis"><span class="modifier">const</span>
     <span class="type">int</span>
      <var class="fieldsynopsis_varname"><a href="class.v8js.html#v8js.constants.flag-none"><var class="varname">FLAG_NONE</var></a></var><span class="initializer"> = 1</span>;</div>

    <div class="fieldsynopsis"><span class="modifier">const</span>
     <span class="type">int</span>
      <var class="fieldsynopsis_varname"><a href="class.v8js.html#v8js.constants.flag-force-array"><var class="varname">FLAG_FORCE_ARRAY</var></a></var><span class="initializer"> = 2</span>;</div>

    
    <div class="classsynopsisinfo classsynopsisinfo_comment">/* Methods */</div>
    <div class="constructorsynopsis dc-description">
   <span class="modifier">public</span> <span class="methodname"><a href="v8js.construct.html" class="methodname">__construct</a></span>(<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type">string</span> <code class="parameter">$object_name</code><span class="initializer"> = &quot;PHP&quot;</span></span>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type">array</span> <code class="parameter">$variables</code><span class="initializer"> = array()</span></span>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type">array</span> <code class="parameter">$extensions</code><span class="initializer"> = array()</span></span>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type">bool</span> <code class="parameter">$report_uncaught_exceptions</code><span class="initializer"> = <strong><code>true</code></strong></span></span><br>)</div>

    <div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="v8js.executestring.html" class="methodname">executeString</a></span>(<span class="methodparam"><span class="type">string</span> <code class="parameter">$script</code></span>, <span class="methodparam"><span class="type">string</span> <code class="parameter">$identifier</code><span class="initializer"> = &quot;V8Js::executeString()&quot;</span></span>, <span class="methodparam"><span class="type">int</span> <code class="parameter">$flags</code><span class="initializer"> = <strong><code>V8Js::FLAG_NONE</code></strong></span></span>): <span class="type"><a href="language.types.declarations.html#language.types.declarations.mixed" class="type mixed">mixed</a></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="modifier">static</span> <span class="methodname"><a href="v8js.getextensions.html" class="methodname">getExtensions</a></span>(): <span class="type">array</span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="v8js.getpendingexception.html" class="methodname">getPendingException</a></span>(): <span class="type"><a href="class.v8jsexception.html" class="type V8JsException">V8JsException</a></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="modifier">static</span> <span class="methodname"><a href="v8js.registerextension.html" class="methodname">registerExtension</a></span>(<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type">string</span> <code class="parameter">$extension_name</code></span>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type">string</span> <code class="parameter">$script</code></span>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type">array</span> <code class="parameter">$dependencies</code><span class="initializer"> = array()</span></span>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type">bool</span> <code class="parameter">$auto_enable</code><span class="initializer"> = <strong><code>false</code></strong></span></span><br>): <span class="type">bool</span></div>

   }</div>


  </div>
  

  <div class="section" id="v8js.constants">
   <h2 class="title">预定义常量</h2>
   <dl>

    
     <dt id="v8js.constants.v8-version"><strong><code>V8Js::V8_VERSION</code></strong></dt>

     <dd>

      <p class="para">The V8 Javascript Engine version.</p>
     </dd>

    

    
     <dt id="v8js.constants.flag-none"><strong><code>V8Js::FLAG_NONE</code></strong></dt>

     <dd>

      <p class="para">No flags.</p>
     </dd>

    

    
     <dt id="v8js.constants.flag-force-array"><strong><code>V8Js::FLAG_FORCE_ARRAY</code></strong></dt>

     <dd>

      <p class="para">Forces all JS objects to be associative arrays in PHP.</p>
     </dd>

    

   </dl>

  </div>



 </div>

 




































<h2>目录</h2><ul class="chunklist chunklist_reference"><li><a href="v8js.construct.html">V8Js::__construct</a> — Construct a new V8Js object</li><li><a href="v8js.executestring.html">V8Js::executeString</a> — Execute a string as Javascript code</li><li><a href="v8js.getextensions.html">V8Js::getExtensions</a> — Return an array of registered extensions</li><li><a href="v8js.getpendingexception.html">V8Js::getPendingException</a> — Return pending uncaught Javascript exception</li><li><a href="v8js.registerextension.html">V8Js::registerExtension</a> — Register Javascript extensions for V8Js</li></ul>
</div>
</div></div></body></html>